import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/modules/account/view/account_textField_monry_Item.dart';
import 'package:honeypotflutter/publicBussine/loginInfo/bussine_userInfo.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_button.dart';
import 'package:honeypotflutter/public/views/public_appBar.dart';
import 'package:honeypotflutter/public/views/public_scrollView.dart';
import 'logic.dart';

class AccountTransferBalancePage extends StatefulWidget {
  const AccountTransferBalancePage({Key? key}) : super(key: key);

  @override
  State<AccountTransferBalancePage> createState() => _AccountTransferBalancePageState();
}

class _AccountTransferBalancePageState extends State<AccountTransferBalancePage> {
  final AccountTransferBalanceLogic logic = Get.put(AccountTransferBalanceLogic());
  final FocusNode _focusNode = FocusNode();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: HLAppBar(
        navigationTitle: "转到余额",
      ),
      body: HLScrollView(
        children: [
          GetBuilder<UserInfoLogic>(
              init: UserInfoLogic(),
              builder: (controller) {
                return AccountTextfieldMonryItem(
                  focusNode: _focusNode,
                  title: "转出到余额",
                  hintText: "可转出金额是${(controller.userInfo.wallet ?? 0.00).toStringAsFixed(2)}元",
                  buttonText: '全部转出',
                  monry: controller.userInfo.wallet ?? 0.00,
                  controller: logic.controller,
                );
              }),
        ],
      ),
      bottomNavigationBar: MGButton(
        title: "确定",
        padding: EdgeInsets.only(left: 30, right: 30, bottom: 30, top: 15),
        buttonAction: logic.sureAction,
      ),
    );
  }

  @override
  void dispose() {
    Get.delete<AccountTransferBalanceLogic>();
    super.dispose();
  }
}
